<?php

namespace App\Providers;

use Illuminate\Support\Facades\Event;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        Registered::class => [
            SendEmailVerificationNotification::class,
        ],
        //订单完成事件
        'App\Events\OrderIsPay'=>[
            //订单完成通知商户
            'App\Listeners\OrderIsPaySmsNotification',
        ],
        //订单已完成事件
        'App\Events\OrderFinished'=>[
            //订单完成通知用户
            'App\Listeners\OrderFinishedSmsNotification',
        ],
        //退款申请事件
        'App\Events\OrderRefund'=>[
            //退款申请通知商户
            'App\Listeners\OrderRefundSmsNotification',
        ],
        //退款完成事件（包括退款成功和退款驳回）
        'App\Events\OrderRefundFinished'=>[
            //退款退款完成通知用户
            'App\Listeners\OrderRefundFinishedSmsNotification',
        ],

    ];

    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        parent::boot();

        //
    }
}
